layui.use('table', function(){
    var table = layui.table;

        table.render({
            elem: '#equipmentTable'
            ,url:'/get/getEquipByPage'
            ,height: document.body.clientHeight-100
            ,toolbar: '#toolbarDemo'
            ,page: true
            ,cols: [[
                {field:'id', title: 'ID',width:80}
                ,{field:'name',title: '设备名称'}
                ,{field:'brand', title: '厂家'}
                ,{field:'ip', title: 'IP' }
                ,{field:'username', title: '地市' }
                ,{field:'port', title: '端口',width: 80 }
                ,{fixed: 'right', title:'操作', toolbar: '#barDemo'}
            ]]
        });

    //头工具栏事件
    table.on('tool(equipment_filter)', function(obj){
        var data = obj.data;
        console.log(data)
        switch(obj.event){
            case 'see':
                //多窗口模式，层叠置顶
                layer.open({
                    type: 2 //此处以iframe举例
                    ,title: data.name
                    ,area: ["1000px","500px"]
                    ,shade: 0
                    ,maxmin: true
                    ,offset: 'auto'
                    ,content: ['/template/equipment-to-file-info.html?param='+data.ip, 'no']
                    ,zIndex: layer.zIndex //重点1
                    ,success: function(layero){
                        layer.setTop(layero); //重点2
                    }
                });
                break;
        };
    });
});